<html>
    <head>
      <title>Library Card</title>
      <meta http-equiv="generator" content="PHP Designer 2005" />
      <style type="text/css">
        @import url(style.css);
      </style>
    </head>
<body>
<?php
require ('db_connection.php');
    $userID = $_GET['userID'];

    $query = "SELECT * FROM tblclient WHERE userID='$userID'";
    $result = mysql_query($query);
    while ($row = mysql_fetch_array($result))
    {
        $libraryCardNo = $row['libraryCardNo'];
        $firstName = $row['firstName'];
        $middleName = $row['middleName'];
        $lastName = $row['lastName'];
        $libraryNo = $row['libraryNo'];
        
    }
    
    $qname = "SELECT * FROM tbllibrary WHERE libraryNo='$libraryNo'";
    $rname = mysql_query($qname);
    while ($row = mysql_fetch_array($rname))
    {
        $libraryName = $row['libraryName'];
    }
    
    $qlib = "SELECT * FROM tbladmin WHERE libraryNo='$libraryNo' AND userType='Administrator'";
    $rlib = mysql_query($qlib);
    while ($row = mysql_fetch_array($rlib))
    {
        $libfirstName = $row['firstName'];
        $liblastName = $row['lastName'];
    }
    
echo "<table width='30%' height='60%' class='id' background='images/back.png'>
<tr><td><img src='images/id.jpg'></td></tr>
<tr><th><u>$libraryName</u></th></tr>
<tr><th>Library Card</th></tr>
<tr><td align='center'><img src='images/photo.png' width='35%' height='85%' class='outerframe'></td></tr>
<tr><th align='center'>$libraryCardNo</th></tr>
<tr><td align='center'>Library No</td></tr>
<tr><th align='center'>$firstName $lastName</th></tr>
<tr><td align='center'>Name</td></tr>
<tr><td align='center'>_________________</td></tr>
<tr><td align='center'>Signature</td></tr>
<tr><th align='center'>$libfirstName $liblastName</th></tr>
<tr><td align='center'>Librarian</td></tr>

</table>";
?>
</body>
</html>
